import { getQueueStatus } from "@/data/options/status";

import { TableColumnData } from "@arco-design/web-vue";
import { TransferItem } from "@arco-design/web-vue/es/transfer/interface";

const t = translate("公共模块");
export const columns: Array<TableColumnData> = [
  {
    title: "价签编码",
    dataIndex: "tagCode",
    width: 180
  },
  {
    title: "商品名称",
    dataIndex: "goodsName"
  },
  {
    title: "下发时间",
    dataIndex: "sendTime"
  },
  {
    title: "完成时间",
    dataIndex: "doneTime"
  },
  {
    title: "状态",
    dataIndex: "status",
    slotName: "status",
    filterable: {
      filters: new Array(5).fill(0).map((_, i) => {
        return {
          text: getQueueStatus(i)?.text,
          value: i.toString()
        };
      }),
      filter: null as any
    }
  },
  {
    title: "错误",
    dataIndex: "err"
  },
  // {
  //   title: "重试次数",
  //   dataIndex: "retryTimes",
  // },
  {
    title: "基站编码",
    dataIndex: "stationNum"
  },
  {
    title: "分辨率",
    dataIndex: "resolutionDesc"
  },
  {
    title: "队列ID",
    dataIndex: "queueId"
  },
  // {
  //   title: "包流号",
  //   dataIndex: "packetSn",
  // },
  {
    title: "操作",
    dataIndex: "optional",
    slotName: "optional",
    width: 120,
    fixed: "right",
    align: "center"
  }
  // {
  //   title: "条形码",
  //   dataIndex: "barCode",
  // },
  // {
  //   title: "零售价",
  //   dataIndex: "retailPrice",
  // },
];

export const transferColumns = (): TransferItem[] => {
  return columns.map((e: any) => {
    return {
      label: t.value?.[e.title],
      value: e.dataIndex,
      disabled: false
    };
  });
};
